﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using GaugeEngine.Graphics;

namespace GaugeEngine
{
    public class Actor
    {
        public Vector Position = new Vector(0,0);
        public float Rotation = 0.0f;
        private string m_name;
        public string Name
        {
            get { return m_name; }
        }

        private List<Behaviour> m_behaviours;

        public Actor(string name)
        {
            m_behaviours = new List<Behaviour>();
            m_name = name;
        }

        public Actor(string name, params Behaviour[] behaviours)
        {
            m_behaviours = new List<Behaviour>();
            foreach (Behaviour b in behaviours) m_behaviours.Add(b);
            m_name = name;
        }

        public void AddBehaviour(Behaviour b)
        {
            m_behaviours.Add(b);
        }

        public void Update(GameTime gameTime)
        {
            foreach (Behaviour b in m_behaviours) b.Update(gameTime);
        }

        public void Draw(Painter p)
        {
            foreach (Behaviour b in m_behaviours) b.Draw(p);
        }
    }
}
